//
//  CMLoginUserInfo.m
//  CreditManger
//
//  Created by chaiyanan on 15/11/5.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "CMLoginUserInfo.h"

@implementation CMLoginUserInfo

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:[DataTypeTranslate stringToString:self.uid] forKey:Key_uid];
    [aCoder encodeObject:[DataTypeTranslate stringToString:self.token] forKey:Key_token];
    [aCoder encodeObject:[DataTypeTranslate stringToString:self.mobile] forKey:Key_mobile];
    [aCoder encodeObject:[DataTypeTranslate stringToString:self.username] forKey:Key_username];
    [aCoder encodeObject:[DataTypeTranslate stringToString:self.cardno] forKey:Key_cardno];
    [aCoder encodeObject:[DataTypeTranslate stringToString:self.headImg] forKey:Key_headImg];
    [aCoder encodeObject:[DataTypeTranslate stringToString:self.identityStatus] forKey:Key_identityStatus];
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    if (self=[super init])
    {
        self.uid = [aDecoder decodeObjectForKey:Key_uid];
        self.token = [aDecoder decodeObjectForKey:Key_token];
        self.mobile = [aDecoder decodeObjectForKey:Key_mobile];
        self.username = [aDecoder decodeObjectForKey:Key_username];
        self.cardno = [aDecoder decodeObjectForKey:Key_cardno];
        self.headImg = [aDecoder decodeObjectForKey:Key_headImg];
        self.identityStatus = [aDecoder decodeObjectForKey:Key_identityStatus];
        
    }
    return self;
}

@end
